<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel="stylesheet" href="../css/login.css">
</head>
<body>

<div class="login-container">
    <h2>用户登录</h2>

    <form method="post" action="/login-process">
        <div>
            <label for="username">用户名：</label>
            <input type="text" id="username" name="username" autocomplete="on" required/>
        </div>
        <div>
            <label for="password">密码：</label>
            <input type="password" id="password" name="password" autocomplete="off" required/>
        </div>

        <!-- 错误提示 -->
        <p th:if="${msg != null}" th:text="${msg}" class="error-message"></p>

        <button type="submit">登录</button>
    </form>

    <a th:href="@{/register}" class="link">没有账号？立即注册</a>
</div>

</body>
</html>
